package org.groupg.project.demo;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;

public class XmlProcessor {
    private static final XmlMapper xmlMapper = JacksonConfigurator.createXmlMapper();

    public static String toXml(Employee employee) throws JsonProcessingException {
        return xmlMapper.writeValueAsString(employee);
    }

    public static Employee fromXml(String xml) throws JsonProcessingException {
        return xmlMapper.readValue(xml, Employee.class);
    }
}